#pragma once

#include "common.h"

// reduced picture size (pixel)

static const int CV_WIDTH  = 400;
static const int CV_HEIGHT = 300;


// delay time reduce CPU (ms)

static const int CV_WAIT   = 10;  //TODO

// noise bound for diff

static const int THRESHOLD_BOUND_X = 10;
static const int THRESHOLD_BOUND_Y = 10;
static const double THRESHOLD_RATE = 0.70;
static const int THRESHOLD_NULL = 1200;


static const int DIFF_HARD = 0;
static const int DIFF_SOFT = 1;

// clip ,.

static const int HIT_FRAME = 4;
const int HIT_RESIST_DIS = 8;
const int HIT_NOISE = 2000;
const double HIT_CENTER_PIXEL_RATE = 0.8;
const int HIT_SPEED_LIMIT = 30;
const int HIT_BALANCE_DIS = 10;
const int HIT_BALANCE_TOT = 50;


// step <>

const clock_t TIME_SLICE = (clock_t)(20 * 0.001 * CLOCKS_PER_SEC);
const int MAX_SLICE = 100;
const int MAX_VALID_POINT = 40;
const int MIN_MOVE_SLICE = 10;
const int MAX_MOVE_SLICE = 50;

const int NOISE_RATE_N = 3;
const int NOISE_RATE_D = 4;

const double SLICE_MAX_MOVE_Y = 12;

const double SLICE_MAX_MOVE_X = 47;
const double SLICE_MIN_MOVE_X = 10;

const int MOVE_DELAY = (clock_t)(750 * 0.001 * CLOCKS_PER_SEC);

// drag move
const int DRAG_THERSHOLD_PIXEL = 40;
const int DRAG_THRESHOLD_ACT = 255 * 200;
const int DRAG_RANGE = 40;

// methods

void cv_main(void);


